/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 17655
 * Date: 2024-12-25
 * Time: 11:27
 */
public class test1 {
    /*
    LeetCode 26  删除有序数组中的重复项
     */
    public int removeDuplicates(int[] nums) {
        if(nums.length==0){
            return 0;
        }
        int fast = 1;
        int slow = 1;
        while(fast<nums.length){
            if(nums[fast]!=nums[fast-1]){
                nums[slow] = nums[fast];
                slow++;
            }
            fast++;
        }
        return slow;
    }
}
